wordpress get user id by email

38

wordpress get user by id -

$user_obj = get_user_by('id', 1);

get current user email wordpress -

global $current_user;
get_currentuserinfo();
echo $current_user->user_email;

wordpress get user id by email -

$user = get_user_by( 'email', '[email protected]' );
$userId = $user->ID;

Comments

Submit
0 Comments